<template>
  <el-card shadow="hover" :body-style="{ padding: '0px' }" v-if="data">
    <div class="top-card">
      <div
        class="top-card-it"
        v-for="(it, i) in data"
        :key="i"
        @click="gotoDetail(it, $router, axios)"
      >
        <img :src="it.icon" />
        <span>{{ it.name }}</span>
      </div>
    </div>
  </el-card>
</template>

<script setup>
import { ref } from "vue";

defineProps({
  data: {
    type: Array,
    default: () => [],
  },
});

const onMouse = ref(-1);
</script>

<style lang="less" scoped>
.top-card {
  display: flex;
  align-items: center;
  height: 140px;
  background: #fff;
  padding: 10px;
  justify-content: space-between;
  &-it {
    width: 120px;
    display: flex;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    img {
      width: 72px;
      height: 72px;
      border-radius: 8px;
      object-fit: cover;
    }

    &:hover{
      img {
        width: 100px;
        height: 100px;
        opacity: 0.6;
        transition: all 0.1s;
      }
      span {
        color: @link-color;
      }
    } 
    span {
      margin-top: 5px;
      font-size: 16px;
      font-weight: 400;
      color: #1d2127;
      line-height: 16px;
    }
  }
}
</style>
